<template>
  <view class="wrap">
    <!-- 未绑定 -->
    <view class="not-bind">
      <view class="equipment-box">
        <image
          class="equipment-image"
          src="https://ainengli.hzjrsw.com/jkhx/weight/viva-icon.png"
          mode="scaleToFill"
        />
        <text class="name">微策血糖/血酮/尿酸分析仪</text>
      </view>
      <view class="bind-box" @tap="bindDevice">
        <text class="bind-text">绑定设备</text>
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
import { onMounted, onUnmounted, ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'

interface deviceData {
  name: string
  deviceId: string
  localName: string
  mac: string
}

const _discoveryStarted = ref<boolean>(false)
const gloableDevices = ref<deviceData[]>([])

const wero = ref<number>(0)

onShow(() => {
  wx.hideHomeButton()
})

onLoad((e: any) => {
  uni.setNavigationBarTitle({
    title: e && e.name == 'analysis' ? '微策三合一分析仪' : ''
  })
})

const bindDevice = () => {
  uni.redirectTo({
    url: '/module/src/pages/myEquipment/detail?name=analysis'
  })
}
</script>
<style lang="scss" scoped>
.wrap,
.not-bind {
  min-height: 100vh;
}

.not-bind {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 80rpx 32rpx 92rpx;
  background-color: #fff;

  .equipment-box {
    display: flex;
    flex-direction: column;
    align-items: center;

    .name {
      font-size: 40rpx;
      font-weight: 700;
      color: #1d2129;
    }
  }

  .bind-box {
    width: 100%;
    height: 88rpx;
    line-height: 88rpx;
    text-align: center;
    background-color: #00d1b6;
    border-radius: 44rpx;

    .bind-text {
      font-size: 32rpx;
      font-weight: 700;
      color: #fff;
    }
  }
}

.device_item {
  padding: 10px;
  line-height: 25px;
  color: #666;
  border-bottom: 1px solid #eee;
}

.equipment-image {
  width: 440rpx;
  height: 440rpx;
  margin-bottom: 50rpx;
}
</style>
